package org.jiajie.designpatterndemo.command.lxf;

/**
 * @author jay
 */
public class Test1 {
    public static void main(String[] args) {
        TextEditor editor = new TextEditor();
        editor.add("Command pattern in text editor.\n");
//        editor.copy();
//        editor.paste();
        // 执行一个 CopyCommand
        Command copy = new CopyCommand(editor);
        copy.execute();
        editor.add("----\n");
        // 执行一个 PasteCommand
        Command paste = new PasteCommand(editor);
        paste.execute();
        System.out.println(editor.getState());
    }
}
